import { Controller, Get, Param, Query } from '@nestjs/common';
import { Dynamic_Service } from '../dynamic/dynamic.service';
import { Dynamic_Find_Dto } from '../dynamic/assets/dynamic.dto';
import { ApiTags } from '@nestjs/swagger';
import { util_ApiResponse_Base } from '@/common/util/apiResponse';
import { util_Index_ReturnContent } from '@/common/util/index';

@Controller('/web/dynamicWeb')
@ApiTags('dynamicWeb 动态资讯')
export class DynamicWeb_Controller {
  constructor(private readonly dynamic_Service: Dynamic_Service) {}

  @Get('/list')
  @util_ApiResponse_Base({
    dataType: 'dataType_list',
    //apiKey: '/web/dynamicWeb/list Get',
    noAuth: true,
  })
  async dynamicWeb_FindByPage(@Query() query: Dynamic_Find_Dto) {
    return util_Index_ReturnContent(await this.dynamic_Service.dynamic_FindByPage(query));
  }

  @Get('/detail/:id')
  @util_ApiResponse_Base({
    dataType: 'dataType_object',
    //apiKey: '/web/dynamicWeb/detail/:id Get',
    noAuth: true,
  })
  async dynamicWeb_FindOneById(@Param('id') id: number) {
    return util_Index_ReturnContent(await this.dynamic_Service.dynamic_FindOneById(id));
  }
}
